/*
* @Author: tomystery
* @Date:   2017-09-08 18:09:46
* @Last Modified by:   tomystery
* @Last Modified time: 2017-09-09 10:46:34
*/
'use strict';
require('./index.css');
var templateIndex=require('./index.string');
require('page/common/nav/index.js');
var navSide=require('page/common/nav-side/index.js');
require('page/common/header/index.js');
var _mm=require('util/mm.js');
var _user=require('service/user-service.js');


//page逻辑部分
var page={
	init:function(){
		this.onLoad();
	},
	onLoad:function(){
		//初始化左侧菜单
		navSide.init({
			name:'user-center'
		});
		//加载用户信息
		this.loadUserInfo();
	},
	//加载用户信息
	loadUserInfo:function(){
		var userHtml='';
		_user.getUserInfo(function(res){
			userHtml=_mm.renderHtml(templateIndex,res);
				$('.panel-body').html(userHtml);
		},function(errMsg){
			_mm.errorTips(errMsg);
		});

	}
};
	

$(function(){
	page.init();
})
